home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / Exec / semaphores.h < prev    next >
C/C++ Source or Header  |  1996-09-10  |  2KB  |  93 lines

  1. #ifndef EXEC_SEMAPHORES_H
  2. #define EXEC_SEMAPHORES_H 1
  3. /*
  4. ** semaphores.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/02/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for semaphores.h
  17. */
  18. #ifndef SemaphorePtr
  19. #define SemaphorePtr ADDRESS
  20. #endif
  21. #ifndef SemaphoreMessagePtr
  22. #define SemaphoreMessagePtr ADDRESS
  23. #endif
  24. #ifndef SemaphoreRequestPtr
  25. #define SemaphoreRequestPtr ADDRESS
  26. #endif
  27. #ifndef SignalSemaphorePtr
  28. #define SignalSemaphorePtr ADDRESS
  29. #endif
  30. /*
  31. ** End of StructPointer defines for semaphores.h
  32. */
  33.       
  34. #ifndef EXEC_NODES_H
  35. #include <exec/nodes.h>
  36. #endif /* EXEC_NODES_H */
  37.  
  38. #ifndef EXEC_LISTS_H
  39. #include <exec/lists.h>
  40. #endif /* EXEC_LISTS_H */
  41.  
  42. #ifndef EXEC_PORTS_H
  43. #include <exec/ports.h>
  44. #endif /* EXEC_PORTS_H */
  45.  
  46. #ifndef EXEC_TASKS_H
  47. #include <exec/tasks.h>
  48. #endif /* EXEC_TASKS_H */
  49.  
  50.  
  51. /****** SignalSemaphore *********************************************/
  52.  
  53. /* Private structure used by ObtainSemaphore() */
  54. STRUCT SemaphoreRequest
  55.  
  56.     MinNode sr_Link 
  57.     TaskPtr  sr_Waiter 
  58. END STRUCT 
  59.  
  60. /* Signal Semaphore data structure */
  61. STRUCT SignalSemaphore
  62.  
  63.     Node ss_Link 
  64.     SHORTINT            ss_NestCount 
  65.     MinList ss_WaitQueue 
  66.     SemaphoreRequest ss_MultipleLink 
  67.     TaskPtr  ss_Owner 
  68.     SHORTINT            ss_QueueCount 
  69. END STRUCT 
  70.  
  71. /****** Semaphore procure message (for use in V39 Procure/Vacate ****/
  72. STRUCT SemaphoreMessage
  73.  
  74.     _Message ssm_Message 
  75.     SignalSemaphorePtr  ssm_Semaphore 
  76. END STRUCT 
  77.  
  78. #define SM_SHARED   (1&)
  79. #define SM_EXCLUSIVE    (0&)
  80.  
  81. /****** Semaphore (Old Procure/Vacate type,  not reliable) ***********/
  82.  
  83. STRUCT Semaphore    /* Do not use these semaphores! */
  84.  
  85.     MsgPort sm_MsgPort 
  86.     SHORTINT    sm_Bids 
  87. END STRUCT 
  88.  
  89. #define sm_LockMsg  mp_SigTask
  90.  
  91.  
  92. #endif  /* EXEC_SEMAPHORES_H */
  93.